﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace YmtAuth.Web.V2.GlobalErrorHandle
{
    public class CustomGlobalErrorHandle : HandleErrorAttribute
    {
        public override void OnException(ExceptionContext filterContext)
        {
            if (filterContext.HttpContext.IsCustomErrorEnabled)
            {
                YmtSystem.CrossCutting.LocalLoggingService.Error("PP");
                filterContext.ExceptionHandled = true;

            }
            base.OnException(filterContext);
            //OVERRIDE THE 500 ERROR            
            filterContext.HttpContext.Response.StatusCode = 200;
        }
    }
}